package com.lzq.leetcode.hoot100;

public class s283 {

    public void moveZeroes(int[] nums) {
        int np = 0;
        int p = 0;
        int len = nums.length;

        while (p < len) {
            if (nums[p++] != 0) {
                nums[np++] = nums[p];
            }
        }

        for (int i=p; i<len; i++) {
            nums[i] = 0;
        }
    }

}
